<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../common/top.jsp" flush="false"></jsp:include>
    <!--本地文件-->

    <!--修改客户详情-->
</head>
<!-- 头部区域 -->
<body>
<div class="layui-layout layui-layout-admin">
    <jsp:include page="../common/header.jsp" flush="false"></jsp:include>
    <jsp:include page="../common/slideNav.jsp" flush="false"></jsp:include>
    <div class="layui-body">
        <div class="layadmin-tabsbody-item layui-show">
            <div class="layui-fluid">
                <div class="layui-card layui-form">
                    <div class="juzhong_box">
                        <div class="juzhong_box_tit">修改客户详情</div>
                        <div class=" layui-card-header layuiadmin-card-header-auto main_tool"
                             lay-filter="layadmin-userfront-formlist">
                            <div class="layui-form-item">
                                <div class="layui-show">
                                    <div class="layui-upload upload_mymanage">
                                        <button type="button" class="layui-btn upload_btn" id="test1">修改头像</button>
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" id="demo1">
                                            <p id="demoText"></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">登录账号</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="account" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">登录密码</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="password" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">昵称</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="nicheng" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">电话</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="dianhua" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">备注</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="beizhu" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-show">
                                    <label class="layui-form-label">性别</label>
                                    <div class="layui-input-block tool_select">
                                        <select name="sex">
                                            <option value="">请选择性别</option>
                                            <option value="0">男</option>
                                            <option value="1">女</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">年龄</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="beizhu" placeholder="请输入" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">类型</label>
                                    <div class="layui-input-block tool_select">
                                        <select name="leixin">
                                            <option value="">请选择类型</option>
                                            <option value="0">总代</option>
                                            <option value="1">经纪人</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">总代标签</label>
                                    <div class="layui-input-block biaoqian_block">
                                        <a class="layui-btn layui-btn-normal layui-btn-sm">全案总代</a>
                                        <a class="layui-btn layui-btn-normal layui-btn-sm">联合代理</a>
                                        <a class="layui-btn layui-btn-normal layui-btn-sm">渠道代理</a>
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <label class="layui-form-label">第三方绑定状态</label>
                                    <div class="layui-input-block input_blockauto">
                                        <label class="layui-form-label">微信</label>
                                        <a class="layui-btn layui-btn-normal layui-btn-sm">解绑</a>
                                    </div>
                                    <div class="layui-input-block input_blockauto">
                                        <label class="layui-form-label">QQ</label>
                                        <a class="layui-btn layui-btn-normal layui-btn-sm">解绑</a>
                                    </div>
                                </div>
                                <div class="layui-show">
                                    <div class="layui-input-block">
                                        <label class="layui-form-label">实名认证详情</label>
                                        <input type="checkbox" name="shiming" lay-skin="switch" lay-text="已实名|未实名">
                                    </div>
                                    <div class="layui-input-block">
                                        <label class="layui-form-label">资质认证详情</label>
                                        <input type="checkbox" name="zizhi" lay-skin="switch" lay-text="已资质认证|未资质认证">
                                    </div>
                                    <div class="layui-input-block">
                                        <label class="layui-form-label">经纪人认证详情</label>
                                        <input type="checkbox" name="jingjiren" lay-skin="switch"
                                               lay-text="已经纪人认证|未经纪人认证">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="table_wrap">
                        <table class="layui-hide" id="kuxq" lay-filter="kuxq"></table>
                    </div>
                    <div class="table_wrap">
                        <table class="layui-hide" id="keyword" lay-filter="keyword"></table>
                    </div>
                    <div class="btn_wrap">
                        <input type="button" lay-submit lay-filter="LAY-user-front-submit" value="确认" class="layui-btn">
                        <input onclick="" type="button" lay-filter="back" value="返回" class="layui-btn">
                        <input  type="button" data-type="jinyan" value="禁言"
                               class="layui-btn layui-btn-danger layuiadmin-btn-useradmin">
                        <input data-type="dongjie" type="button" lay-filter="dongjie" value="冻结"
                               class="layui-btn layui-btn-normal layuiadmin-btn-useradmin">
                    </div>
                </div>
            </div>
        </div>
    </div>
        <!--禁言弹框-->
        <div id="jinyanbox" class="layui-form hide_this" lay-filter="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
            <div class="layui-form-item" pane="">
                <label style="width: 100px;" class="layui-form-label">选取禁言的栏目</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="dongtai" lay-skin="primary" title="发布动态" checked="">
                    <input type="checkbox" name="guangchang" lay-skin="primary" title="发布广场信息">
                    <input type="checkbox" name="zixun" lay-skin="primary" title="咨询评论">
                    <input type="checkbox" name="zhaopin" lay-skin="primary" title="发布招聘">
                    <input type="checkbox" name="qiuzhi" lay-skin="primary" title="发布求职">
                    <input type="checkbox" name="fbfangyuan" lay-skin="primary" title="发布房源">
                    <input type="checkbox" name="pingjia" lay-skin="primary" title="房源评价">
                    <input type="checkbox" name="dongtai" lay-skin="primary" title="房源动态">
                </div>
            </div>
            <div class="btn_wrap">
                <input type="button" lay-submit lay-filter="LAY-user-front-submit" value="确认" class="layui-btn">
                <input onclick="layer.closeAll()" type="button"  lay-filter="back" value="返回" class="layui-btn">
            </div>
        </div>
        <!--冻结弹框-->
        <div id="dongjiebox" class="layui-form hide_this layui-form-pane" lay-filter="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
            <div class="layui-form-item">
                <div class="btn_wrap">
                <div class="layui-inline">
                    <label class="layui-form-label">冻结天数</label>
                    <div class="layui-input-inline">
                        <input type="text" name="dongjie" autocomplete="off" class="layui-input">
                    </div>
                </div>
                </div>
            </div>
            <div class="btn_wrap">
                <input type="button" lay-submit lay-filter="LAY-user-front-submit" value="确认" class="layui-btn">
                <input onclick="layer.closeAll()" type="button"  lay-filter="back" value="返回" class="layui-btn">
            </div>
        </div>
    <script>
        $(function () {
            layui.use(['element', 'layer', 'form', 'layedit', 'laydate', 'table','upload'], function () {
                var element = layui.element, //导航的hover效果、二级菜单等功能，需要依赖element模块
                    layer = layui.layer, //弹窗模块
                    layedit = layui.layedit, //编辑器
                    laydate = layui.laydate, //日期选择器
                    form = layui.form, //表单
                    table = layui.table, //表格
                    upload = layui.upload;   //图片上传
                //用户管理
                //事件
                var active = {
                    //禁言弹框
                    jinyan:function () {
                        layer.open({
                            type: 1,
                            title: '禁言'
                            , area: ['650px', 'auto']
                            , closeBtn: 1
                            , skin: 'layui-layer-admin'
                            , content: $("#jinyanbox")
                            , success: function (layero, index) {
                                form.render(null, 'layuiadmin-form-useradmin');
                                //监听提交
                                form.on('submit(LAY-user-front-submit)', function (data) {
                                    var field = data.field; //获取提交的字段
                                    //提交 Ajax 成功后，关闭当前弹层并重载表格
                                    layer.msg(JSON.stringify(data.field));
                                    //$.ajax({});
                                    layui.table.reload('quanxian'); //重载表格
                                    layer.close(index); //执行关闭
                                });
                            }
                        })
                    },
                    dongjie:function () {
                        layer.open({
                            type: 1,
                            title: '冻结登录权限'
                            , area: ['650px', 'auto']
                            , closeBtn: 1
                            , skin: 'layui-layer-admin'
                            , content: $("#dongjiebox")
                            , success: function (layero, index) {
                                form.render(null, 'layuiadmin-form-useradmin');
                                //监听提交
                                form.on('submit(LAY-user-front-submit)', function (data) {
                                    var field = data.field; //获取提交的字段
                                    //提交 Ajax 成功后，关闭当前弹层并重载表格
                                    layer.msg(JSON.stringify(data.field));
                                    //$.ajax({});
                                    layui.table.reload('quanxian'); //重载表格
                                    layer.close(index); //执行关闭
                                });
                            }
                        })
                    }
                };
                //一个表格
                table.render({
                    elem: '#kuxq',
                    id: 'kuxq',
                    data: [{
                        "idname1": "3"
                        , "idname2": "33"
                        , "idname3": "32"
                        , "idname4": "2"
                        , "idname5": "33"
                        , "idname6": "6"
                        , "idname7": "2019-09-09"
                        , "idname8": "2019-09-09"
                        , "idname9": "300小时"
                        , "idname10": ""
                        , "idname11": ""
                    }],
                    cols: [
                        [{
                            field: 'idname1',
                            title: '收藏数',
                        }, {
                            field: 'idname2',
                            title: '动态发布数',
                        }, {
                            field: 'idname3',
                            title: '广场发布数',
                        }, {
                            field: 'idname4',
                            title: '楼盘发布数'
                        }, {
                            field: 'idname5',
                            title: '招聘发布数',
                        }, {
                            field: 'idname6',
                            title: '求职发布数'
                        }, {
                            field: 'idname7',
                            title: '注册时间'
                        }, {
                            field: 'idname8',
                            title: '最近登录时间'
                        }, {
                            field: 'idname9',
                            title: '累计登录时间',
                        }, {
                            field: 'idname10',
                            title: '修改人',
                        },
                            {
                                field: 'idname11',
                                title: '修改时间',
                            }]
                    ],
                    page: false,
                    cellMinWidth: 80,
                    limit: 1,
                    text: '对不起，加载出现异常！'
                });
                //第二个表格
                table.render({
                    elem: '#keyword',
                    id: 'keyword',
                    data: [{
                        "idname0": "关键词提及次数",
                        "idname1": "3"
                        , "idname2": "33"
                        , "idname3": "3"
                        , "idname4": "2"
                        , "idname5": "33"
                        , "idname6": "6"
                        , "idname7": "0"
                    }],
                    cols: [
                        [
                            {
                                field: 'idname0',
                                title: '',
                            }, {
                            field: 'idname1',
                            title: '动态/广场信息',
                        }, {
                            field: 'idname2',
                            title: '咨询评论',
                        }, {
                            field: 'idname3',
                            title: '发布招聘',
                        }, {
                            field: 'idname4',
                            title: '发布求职'
                        }, {
                            field: 'idname5',
                            title: '发布房源',
                        }, {
                            field: 'idname6',
                            title: '房源评价'
                        }, {
                            field: 'idname7',
                            title: '房源动态'
                        }]
                    ],
                    page: false,
                    cellMinWidth: 80,
                    limit: 1,
                    text: '对不起，加载出现异常！'
                });
                //开关监听
                form.on('switch()', function (data) {
                    layer.msg('开关' + data.elem.name + '：' + (this.checked ? 'true' : 'false'), {
                        offset: '6px'
                    });
                    console.log(data.elem); //得到checkbox原始DOM对象
                    console.log(data.elem.checked); //开关是否开启，true或者false
                    console.log(data.value); //开关value值，也可以通过data.elem.value得到
                    console.log(data.othis); //得到美化后的DOM对象
                });
                //监听提交
                form.on('submit(LAY-user-front-submit)', function (data) {
                    var field = data.field; //获取提交的字段
                    //提交 Ajax 成功后，关闭当前弹层并重载表格
                    layer.msg(JSON.stringify(data.field));
                    //$.ajax({});
                });
                //普通图片上传
                var uploadInst = upload.render({
                    elem: '#test1'
                    ,url: '/upload/'
                    ,before: function(obj){
                        //预读本地文件示例，不支持ie8
                        obj.preview(function(index, file, result){
                            $('#demo1').attr('src', result); //图片链接（base64）
                        });
                    }
                    ,done: function(res){
                        //如果上传失败
                        if(res.code > 0){
                            return layer.msg('上传失败');
                        }
                        //上传成功
                    }
                    ,error: function(){
                        //演示失败状态，并实现重传
                        var demoText = $('#demoText');
                        demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                        demoText.find('.demo-reload').on('click', function(){
                            uploadInst.upload();
                        });
                    }
                });
                /*绑定按钮事件 添加删除等功能按钮*/
                $('.layui-btn.layuiadmin-btn-useradmin').on('click', function () {
                    var type = $(this).data('type');
                    active[type] ? active[type].call(this) : '';
                });
            });
        })
    </script>

</body>

</html>